
import { UserState , Actions} from "../../utils/types";

const initState:UserState = {
    pageSize:1,
    limit:10,
    total:0,
    val:"",
    userList:[]
};


const userReducer = (state=initState , { type , payload}:Actions) => {

    switch(type){
        case "ADD_USER_LIST":
            return {
                ...state,
                total:payload.total,
                userList:[...payload.result]
            }
        default:
            return {
                ...state
            }
    }
};


export default userReducer;

